package br.com.webcrm.dao.impl;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import br.com.webcrm.dao.EnderecoDAO;
import br.com.webcrm.model.Endereco;

@Repository(value = "enderecoDAO")
public class EnderecoDAOImpl extends BaseDAOImpl<Endereco, Integer> implements EnderecoDAO {
	
	@Autowired
	public EnderecoDAOImpl(@Qualifier("sessionFactory") SessionFactory factory) {
		super.setSessionFactory(factory);
	}	

	@Override
	public List<Endereco> consultarPorIdEntidade(Integer idEntidade)
			throws Exception {
		String[] nomes = {"idEntidade"};
		Object[] valores = {idEntidade};
		return consultarPorNamedQueryEParametros("Endereco.findByIdEntidade", nomes, valores);
	}

	@Override
	public List<Endereco> consultarPorComplemento(String complemento)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Endereco> consultarPorTipoEndereco(Integer IdTipoEndereco)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}
	

}
